package cn.gson.crm.controller.custom;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.gson.crm.controller.BaseServlet;
import cn.gson.crm.model.dao.CustomDao;

/**
 * 分配客户
 */
@WebServlet("/custom/assign")
public class CustomAssignServlet extends BaseServlet {
	private static final long serialVersionUID = 1L;
	private CustomDao customDao=new CustomDao();

	protected void get(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String[] ids=request.getParameterValues("id");
		String empid=request.getParameter("empid");
		for (String id : ids) {
			//System.out.println(id+" id");
			boolean result=customDao.assignCustom(empid,id);
			if(!result){
				errorForward("分配失败", "custom/custom.jsp");
				return;
			}
		}
		redirect("custom");
		
	}
	
}
